<template>
  <div class="wrapper">
    <h1>Vue3.0 + TypeScript</h1>
    <TodoInput />
    <TodoList :todoList="todoList" />
  </div>
</template>

<script lang="ts">
import { computed, defineComponent, onMounted } from 'vue'
import { useStore, Store } from 'vuex'
import TodoInput from './components/TodoInput/index.vue'
import TodoList from './components/TodoList/index.vue'
import { IUseTodo, useTodo } from './hooks'
export default defineComponent({
  name: 'App',
  components: { TodoInput, TodoList },
  setup() {
    const { setTodoList }: IUseTodo = useTodo()
    const store: Store<any> = useStore()
    onMounted(() => {
      setTodoList()
    })
    return {
      todoList: computed(() => store.state.list),
    }
  },
})
</script>


<style lang="scss">
</style>
